<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ESP32VGA: FabGL::TerminalClass Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP32VGA
   </div>
   <div id="projectbrief">ESP32 VGA Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>FabGL</b></li><li class="navelem"><a class="el" href="class_fab_g_l_1_1_terminal_class.html">TerminalClass</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_fab_g_l_1_1_terminal_class-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">FabGL::TerminalClass Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>An ANSI-VT100 compatible display terminal.  
 <a href="class_fab_g_l_1_1_terminal_class.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="terminal_8h_source.html">terminal.h</a>&gt;</code></p>

<p>Inherits Stream.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad37042433732925d72272f4ad9cf3849"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#ad37042433732925d72272f4ad9cf3849">begin</a> ()</td></tr>
<tr class="memdesc:ad37042433732925d72272f4ad9cf3849"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the terminal.  <a href="#ad37042433732925d72272f4ad9cf3849">More...</a><br /></td></tr>
<tr class="separator:ad37042433732925d72272f4ad9cf3849"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99441811a4cb79a0761b0edff1260462"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a99441811a4cb79a0761b0edff1260462">end</a> ()</td></tr>
<tr class="memdesc:a99441811a4cb79a0761b0edff1260462"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finalize the terminal.  <a href="#a99441811a4cb79a0761b0edff1260462">More...</a><br /></td></tr>
<tr class="separator:a99441811a4cb79a0761b0edff1260462"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a050039c3c30e2591aa09d7b49073a452"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a050039c3c30e2591aa09d7b49073a452">connectSerialPort</a> (HardwareSerial &amp;serialPort, bool autoXONXOFF=true)</td></tr>
<tr class="memdesc:a050039c3c30e2591aa09d7b49073a452"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect a remove host using the specified serial port.  <a href="#a050039c3c30e2591aa09d7b49073a452">More...</a><br /></td></tr>
<tr class="separator:a050039c3c30e2591aa09d7b49073a452"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a191fcce92df0611dad8dfe8dbda6466d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a191fcce92df0611dad8dfe8dbda6466d">pollSerialPort</a> ()</td></tr>
<tr class="memdesc:a191fcce92df0611dad8dfe8dbda6466d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pool the serial port for incoming data.  <a href="#a191fcce92df0611dad8dfe8dbda6466d">More...</a><br /></td></tr>
<tr class="separator:a191fcce92df0611dad8dfe8dbda6466d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21b8c89ca320cb271ee7204f7e661e48"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a21b8c89ca320cb271ee7204f7e661e48">connectLocally</a> ()</td></tr>
<tr class="memdesc:a21b8c89ca320cb271ee7204f7e661e48"><td class="mdescLeft">&#160;</td><td class="mdescRight">Permits using of terminal locally.  <a href="#a21b8c89ca320cb271ee7204f7e661e48">More...</a><br /></td></tr>
<tr class="separator:a21b8c89ca320cb271ee7204f7e661e48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2f3c3b588e654c3c4a7b2911f333976"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#ae2f3c3b588e654c3c4a7b2911f333976">localWrite</a> (uint8_t c)</td></tr>
<tr class="memdesc:ae2f3c3b588e654c3c4a7b2911f333976"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inject keys into the keyboard queue.  <a href="#ae2f3c3b588e654c3c4a7b2911f333976">More...</a><br /></td></tr>
<tr class="separator:ae2f3c3b588e654c3c4a7b2911f333976"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b275e00f79a9748bb6e0e57baee6414"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a7b275e00f79a9748bb6e0e57baee6414">localWrite</a> (char const *str)</td></tr>
<tr class="memdesc:a7b275e00f79a9748bb6e0e57baee6414"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inject a string of keys into the keyboard queue.  <a href="#a7b275e00f79a9748bb6e0e57baee6414">More...</a><br /></td></tr>
<tr class="separator:a7b275e00f79a9748bb6e0e57baee6414"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab11e6662766219868ea90beea5612f72"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#ab11e6662766219868ea90beea5612f72">setLogStream</a> (Stream &amp;stream)</td></tr>
<tr class="memdesc:ab11e6662766219868ea90beea5612f72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the stream where to output debugging logs.  <a href="#ab11e6662766219868ea90beea5612f72">More...</a><br /></td></tr>
<tr class="separator:ab11e6662766219868ea90beea5612f72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b5c9a68d2d53c7dbb61edfeda371c59"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a3b5c9a68d2d53c7dbb61edfeda371c59">loadFont</a> (FontInfo const *font)</td></tr>
<tr class="memdesc:a3b5c9a68d2d53c7dbb61edfeda371c59"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the font to use.  <a href="#a3b5c9a68d2d53c7dbb61edfeda371c59">More...</a><br /></td></tr>
<tr class="separator:a3b5c9a68d2d53c7dbb61edfeda371c59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aecadae9531f1f3be9767cf0cb857457d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#aecadae9531f1f3be9767cf0cb857457d">setBackgroundColor</a> (<a class="el" href="vgacontroller_8h.html#ab329a30a424ffbdadd1871763dd5b433">Color</a> color, bool setAsDefault=true)</td></tr>
<tr class="memdesc:aecadae9531f1f3be9767cf0cb857457d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the background color.  <a href="#aecadae9531f1f3be9767cf0cb857457d">More...</a><br /></td></tr>
<tr class="separator:aecadae9531f1f3be9767cf0cb857457d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bf4332fc5f7fd57ad13ee7444633bb7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a3bf4332fc5f7fd57ad13ee7444633bb7">setForegroundColor</a> (<a class="el" href="vgacontroller_8h.html#ab329a30a424ffbdadd1871763dd5b433">Color</a> color, bool setAsDefault=true)</td></tr>
<tr class="memdesc:a3bf4332fc5f7fd57ad13ee7444633bb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the foreground color.  <a href="#a3bf4332fc5f7fd57ad13ee7444633bb7">More...</a><br /></td></tr>
<tr class="separator:a3bf4332fc5f7fd57ad13ee7444633bb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d62e6aa476a199e603b73f0eebbeff4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a9d62e6aa476a199e603b73f0eebbeff4">clear</a> ()</td></tr>
<tr class="memdesc:a9d62e6aa476a199e603b73f0eebbeff4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear the screen.  <a href="#a9d62e6aa476a199e603b73f0eebbeff4">More...</a><br /></td></tr>
<tr class="separator:a9d62e6aa476a199e603b73f0eebbeff4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d3753c5b34ff9d40d4d20813dfdb22a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a8d3753c5b34ff9d40d4d20813dfdb22a">flush</a> (bool waitVSync)</td></tr>
<tr class="memdesc:a8d3753c5b34ff9d40d4d20813dfdb22a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for all codes sent to the display has been processed.  <a href="#a8d3753c5b34ff9d40d4d20813dfdb22a">More...</a><br /></td></tr>
<tr class="separator:a8d3753c5b34ff9d40d4d20813dfdb22a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae71b20850edbb23114e17d99128be109"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#ae71b20850edbb23114e17d99128be109">getColumns</a> ()</td></tr>
<tr class="memdesc:ae71b20850edbb23114e17d99128be109"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of columns.  <a href="#ae71b20850edbb23114e17d99128be109">More...</a><br /></td></tr>
<tr class="separator:ae71b20850edbb23114e17d99128be109"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec8b3377ab57f65952b5cd2e42ca14a4"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#aec8b3377ab57f65952b5cd2e42ca14a4">getRows</a> ()</td></tr>
<tr class="memdesc:aec8b3377ab57f65952b5cd2e42ca14a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of lines.  <a href="#aec8b3377ab57f65952b5cd2e42ca14a4">More...</a><br /></td></tr>
<tr class="separator:aec8b3377ab57f65952b5cd2e42ca14a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafb6b0ea99b66f6b5a324ce1d44f29f8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#aafb6b0ea99b66f6b5a324ce1d44f29f8">enableCursor</a> (bool value)</td></tr>
<tr class="memdesc:aafb6b0ea99b66f6b5a324ce1d44f29f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable or disable cursor.  <a href="#aafb6b0ea99b66f6b5a324ce1d44f29f8">More...</a><br /></td></tr>
<tr class="separator:aafb6b0ea99b66f6b5a324ce1d44f29f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61af3f31cdd2bae2633eda5e86b11b2b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a61af3f31cdd2bae2633eda5e86b11b2b">availableForWrite</a> ()</td></tr>
<tr class="memdesc:a61af3f31cdd2bae2633eda5e86b11b2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return number of codes that the display input queue can still accept.  <a href="#a61af3f31cdd2bae2633eda5e86b11b2b">More...</a><br /></td></tr>
<tr class="separator:a61af3f31cdd2bae2633eda5e86b11b2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44f4a4963f7b698583b237d20ee66fe5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a44f4a4963f7b698583b237d20ee66fe5">available</a> ()</td></tr>
<tr class="memdesc:a44f4a4963f7b698583b237d20ee66fe5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of codes available in the keyboard queue.  <a href="#a44f4a4963f7b698583b237d20ee66fe5">More...</a><br /></td></tr>
<tr class="separator:a44f4a4963f7b698583b237d20ee66fe5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1218bbf01af0ccb59aef07ae36a8793"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#aa1218bbf01af0ccb59aef07ae36a8793">read</a> ()</td></tr>
<tr class="memdesc:aa1218bbf01af0ccb59aef07ae36a8793"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read codes from keyboard.  <a href="#aa1218bbf01af0ccb59aef07ae36a8793">More...</a><br /></td></tr>
<tr class="separator:aa1218bbf01af0ccb59aef07ae36a8793"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4d97a111f6abc956586de7d75a8bc78"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#ae4d97a111f6abc956586de7d75a8bc78">peek</a> ()</td></tr>
<tr class="memdesc:ae4d97a111f6abc956586de7d75a8bc78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a code from the keyboard without advancing to the next one.  <a href="#ae4d97a111f6abc956586de7d75a8bc78">More...</a><br /></td></tr>
<tr class="separator:ae4d97a111f6abc956586de7d75a8bc78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65351e05fef9b22bb5330472badc8840"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a65351e05fef9b22bb5330472badc8840">flush</a> ()</td></tr>
<tr class="memdesc:a65351e05fef9b22bb5330472badc8840"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for all codes sent to the display has been processed.  <a href="#a65351e05fef9b22bb5330472badc8840">More...</a><br /></td></tr>
<tr class="separator:a65351e05fef9b22bb5330472badc8840"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2540979f774634ea7264ba1e1764b380"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a2540979f774634ea7264ba1e1764b380">write</a> (const uint8_t *buffer, size_t size)</td></tr>
<tr class="memdesc:a2540979f774634ea7264ba1e1764b380"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send specified number of codes to the display.  <a href="#a2540979f774634ea7264ba1e1764b380">More...</a><br /></td></tr>
<tr class="separator:a2540979f774634ea7264ba1e1764b380"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a026b4983543e8ab8689cffa847b73d51"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fab_g_l_1_1_terminal_class.html#a026b4983543e8ab8689cffa847b73d51">write</a> (uint8_t c)</td></tr>
<tr class="memdesc:a026b4983543e8ab8689cffa847b73d51"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a single code to the display.  <a href="#a026b4983543e8ab8689cffa847b73d51">More...</a><br /></td></tr>
<tr class="separator:a026b4983543e8ab8689cffa847b73d51"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An ANSI-VT100 compatible display terminal. </p>
<p>Implements most of common ANSI, VT52, VT100, VT200, VT300, VT420 and VT500 escape codes, like non-CSI codes (RIS, IND, DECID, DECDHL, etc..), like CSI codes (private modes, CUP, TBC, etc..), like CSI-SGR codes (bold, italic, blinking, etc...) and like DCS codes (DECRQSS, etc..). Supports convertion from PS/2 keyboard virtual keys to ANSI or VT codes (keypad, cursor keys, function keys, etc..).</p>
<p><a class="el" href="class_fab_g_l_1_1_terminal_class.html" title="An ANSI-VT100 compatible display terminal. ">TerminalClass</a> can receive codes to display from Serial Port or it can be controlled directly from the application. In the same way <a class="el" href="class_fab_g_l_1_1_terminal_class.html" title="An ANSI-VT100 compatible display terminal. ">TerminalClass</a> can send keyboard codes to a Serial Port or directly to the application.</p>
<p>For default it supports 80x25 or 132x25 characters at 640x350. However any custom resolution and text buffer size is supported specifying a custom font.</p>
<p>There are three cursors styles (block, underlined and bar), blinking or not blinking.</p>
<p><a class="el" href="class_fab_g_l_1_1_terminal_class.html" title="An ANSI-VT100 compatible display terminal. ">TerminalClass</a> inherits from Stream so applications can use all Stream and Print input and output methods.</p>
<p><a class="el" href="class_fab_g_l_1_1_terminal_class.html" title="An ANSI-VT100 compatible display terminal. ">TerminalClass</a> passes 95/110 of VTTEST VT100/VT102 Compatibility Test Score Sheet.</p>
<p>Applications do not need to create an instance of <a class="el" href="class_fab_g_l_1_1_terminal_class.html" title="An ANSI-VT100 compatible display terminal. ">TerminalClass</a> because an instance named Terminal is created automatically.</p>
<p>Example 1: </p><pre class="fragment">// Setup 80x25 columns loop-back terminal (send what you type on keyboard to the display)
void setup() {
  Keyboard.begin(GPIO_NUM_33, GPIO_NUM_32);  // GPIOs for keyboard (CLK, DATA)

  // GPIOs for VGA (RED0, RED1, GREEN0, GREEN1, BLUE0, BLUE1, HSYNC, VSYNC)
  VGAController.begin(GPIO_NUM_22, GPIO_NUM_21, GPIO_NUM_19, GPIO_NUM_18, GPIO_NUM_5, GPIO_NUM_4, GPIO_NUM_23, GPIO_NUM_15);
  VGAController.setResolution(VGA_640x350_70HzAlt1, 640, 350); // 640x350, 80x25 columns

  Terminal.begin();
  Terminal.connectLocally();      // to use Terminal.read(), available(), etc..
  Terminal.enableCursor(true);
}

void loop() {
  if (Terminal.available()) {
    char c = Terminal.read();
    switch (c) {
      case 0x7F:       // DEL -&gt; backspace + ESC[K
        Terminal.write("\b\e[K");
        break;
      case 0x0D:       // CR  -&gt; CR + LF
        Terminal.write("\r\n");
        break;
      case 32 ... 126: // printable chars
        Terminal.write(c);
        break;
    }
  }
}
</pre><p>Example 2: </p><pre class="fragment">// Setup 80x25 columns terminal using UART2 to communicate with the server,
// VGA to display output and PS2 device as keyboard input
void setup() {
  Serial2.begin(115200);

  Keyboard.begin(GPIO_NUM_33, GPIO_NUM_32); // GPIOs for keyboard (CLK, DATA)

  // GPIOs for VGA (RED0, RED1, GREEN0, GREEN1, BLUE0, BLUE1, HSYNC, VSYNC)
  VGAController.begin(GPIO_NUM_22, GPIO_NUM_21, GPIO_NUM_19, GPIO_NUM_18, GPIO_NUM_5, GPIO_NUM_4, GPIO_NUM_23, GPIO_NUM_15);
  VGAController.setResolution(VGA_640x350_70HzAlt1, 640, 350); // 640x350, 80x25 columns

  Terminal.begin();
  Terminal.connectSerialPort(Serial2);
  Terminal.enableCursor(true);
}

void loop() {
  Terminal.pollSerialPort();
}</pre> </div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a44f4a4963f7b698583b237d20ee66fe5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44f4a4963f7b698583b237d20ee66fe5">&#9670;&nbsp;</a></span>available()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int FabGL::TerminalClass::available </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the number of codes available in the keyboard queue. </p>
<p>Keyboard queue is available only after <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a21b8c89ca320cb271ee7204f7e661e48" title="Permits using of terminal locally. ">TerminalClass.connectLocally()</a> call.</p>
<dl class="section return"><dt>Returns</dt><dd>The number of codes available to read. </dd></dl>

</div>
</div>
<a id="a61af3f31cdd2bae2633eda5e86b11b2b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61af3f31cdd2bae2633eda5e86b11b2b">&#9670;&nbsp;</a></span>availableForWrite()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int FabGL::TerminalClass::availableForWrite </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return number of codes that the display input queue can still accept. </p>
<dl class="section return"><dt>Returns</dt><dd>The size (in characters) of remaining space in the display queue. </dd></dl>

</div>
</div>
<a id="ad37042433732925d72272f4ad9cf3849"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad37042433732925d72272f4ad9cf3849">&#9670;&nbsp;</a></span>begin()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::begin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the terminal. </p>
<p>Applications should call this method before any other method call or after resolution has been set. </p>

</div>
</div>
<a id="a9d62e6aa476a199e603b73f0eebbeff4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d62e6aa476a199e603b73f0eebbeff4">&#9670;&nbsp;</a></span>clear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clear the screen. </p>
<p>Clears the screen sending "CSI 2 J" command to the screen.</p>
<p>Example: </p><pre class="fragment">   // Fill the screen with blue
   Terminal.setBackgroundColor(Color::Blue);
   Terminal.clear();</pre> 
</div>
</div>
<a id="a21b8c89ca320cb271ee7204f7e661e48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a21b8c89ca320cb271ee7204f7e661e48">&#9670;&nbsp;</a></span>connectLocally()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::connectLocally </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Permits using of terminal locally. </p>
<p>Create a queue where to put ANSI keys decoded from keyboard or as replies to terminal queries. This queue is accessible with <a class="el" href="class_fab_g_l_1_1_terminal_class.html#aa1218bbf01af0ccb59aef07ae36a8793" title="Read codes from keyboard. ">read()</a>, <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a44f4a4963f7b698583b237d20ee66fe5" title="Get the number of codes available in the keyboard queue. ">available()</a> and <a class="el" href="class_fab_g_l_1_1_terminal_class.html#ae4d97a111f6abc956586de7d75a8bc78" title="Read a code from the keyboard without advancing to the next one. ">peek()</a> methods.</p>
<p>Example: </p><pre class="fragment">   Terminal.begin();
   Terminal.connectLocally();
   // from here you can use Terminal.read() to receive keys from keyboard
   // and Terminal.write() to control the display.</pre> 
</div>
</div>
<a id="a050039c3c30e2591aa09d7b49073a452"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a050039c3c30e2591aa09d7b49073a452">&#9670;&nbsp;</a></span>connectSerialPort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::connectSerialPort </td>
          <td>(</td>
          <td class="paramtype">HardwareSerial &amp;&#160;</td>
          <td class="paramname"><em>serialPort</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>autoXONXOFF</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect a remove host using the specified serial port. </p>
<p>When serial port is set, the typed keys on PS/2 keyboard are encoded as ANSI/VT100 codes and then sent to the specified serial port. Also replies to terminal queries like terminal identification, cursor position, etc.. will be sent to the serial port. Call <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a191fcce92df0611dad8dfe8dbda6466d" title="Pool the serial port for incoming data. ">TerminalClass.pollSerialPort()</a> to send codes from serial port to the display.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">serialPort</td><td>The serial port to use. </td></tr>
    <tr><td class="paramname">autoXONXOFF</td><td>If true uses software flow control (XON/XOFF).</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><pre class="fragment">  Terminal.begin();
  Terminal.connectSerialPort(Serial);</pre> 
</div>
</div>
<a id="aafb6b0ea99b66f6b5a324ce1d44f29f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafb6b0ea99b66f6b5a324ce1d44f29f8">&#9670;&nbsp;</a></span>enableCursor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::enableCursor </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable or disable cursor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>If true the cursor becomes visible. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a99441811a4cb79a0761b0edff1260462"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a99441811a4cb79a0761b0edff1260462">&#9670;&nbsp;</a></span>end()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::end </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finalize the terminal. </p>
<p>Applications should call this method before screen resolution changes. </p>

</div>
</div>
<a id="a8d3753c5b34ff9d40d4d20813dfdb22a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d3753c5b34ff9d40d4d20813dfdb22a">&#9670;&nbsp;</a></span>flush() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::flush </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>waitVSync</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wait for all codes sent to the display has been processed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">waitVSync</td><td>If true codes are processed during screen retrace time (starting from VSync up to about first top visible row). When false all messages are processed immediately. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a65351e05fef9b22bb5330472badc8840"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a65351e05fef9b22bb5330472badc8840">&#9670;&nbsp;</a></span>flush() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::flush </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wait for all codes sent to the display has been processed. </p>
<p>Codes are processed during screen retrace time (starting from VSync up to about first top visible row). </p>

</div>
</div>
<a id="ae71b20850edbb23114e17d99128be109"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae71b20850edbb23114e17d99128be109">&#9670;&nbsp;</a></span>getColumns()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int16_t FabGL::TerminalClass::getColumns </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the number of columns. </p>
<dl class="section return"><dt>Returns</dt><dd>The number of columns (in characters). </dd></dl>

</div>
</div>
<a id="aec8b3377ab57f65952b5cd2e42ca14a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec8b3377ab57f65952b5cd2e42ca14a4">&#9670;&nbsp;</a></span>getRows()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int16_t FabGL::TerminalClass::getRows </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the number of lines. </p>
<dl class="section return"><dt>Returns</dt><dd>The number of lines (in characters). </dd></dl>

</div>
</div>
<a id="a3b5c9a68d2d53c7dbb61edfeda371c59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b5c9a68d2d53c7dbb61edfeda371c59">&#9670;&nbsp;</a></span>loadFont()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::loadFont </td>
          <td>(</td>
          <td class="paramtype">FontInfo const *&#160;</td>
          <td class="paramname"><em>font</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the font to use. </p>
<p>Terminal automatically choises the best font considering screen resolution and required number of columns and rows. Particular cases require setting custom fonts, so applications can use <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a3b5c9a68d2d53c7dbb61edfeda371c59" title="Set the font to use. ">TerminalClass.loadFont()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">font</td><td>Specifies font info for the font to set. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae2f3c3b588e654c3c4a7b2911f333976"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae2f3c3b588e654c3c4a7b2911f333976">&#9670;&nbsp;</a></span>localWrite() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::localWrite </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Inject keys into the keyboard queue. </p>
<p>Characters added with <a class="el" href="class_fab_g_l_1_1_terminal_class.html#ae2f3c3b588e654c3c4a7b2911f333976" title="Inject keys into the keyboard queue. ">localWrite()</a> will be received with <a class="el" href="class_fab_g_l_1_1_terminal_class.html#aa1218bbf01af0ccb59aef07ae36a8793" title="Read codes from keyboard. ">read()</a>, <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a44f4a4963f7b698583b237d20ee66fe5" title="Get the number of codes available in the keyboard queue. ">available()</a> and <a class="el" href="class_fab_g_l_1_1_terminal_class.html#ae4d97a111f6abc956586de7d75a8bc78" title="Read a code from the keyboard without advancing to the next one. ">peek()</a> methods.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>ASCII code to inject into the queue. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a7b275e00f79a9748bb6e0e57baee6414"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b275e00f79a9748bb6e0e57baee6414">&#9670;&nbsp;</a></span>localWrite() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::localWrite </td>
          <td>(</td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Inject a string of keys into the keyboard queue. </p>
<p>Characters added with <a class="el" href="class_fab_g_l_1_1_terminal_class.html#ae2f3c3b588e654c3c4a7b2911f333976" title="Inject keys into the keyboard queue. ">localWrite()</a> will be received with <a class="el" href="class_fab_g_l_1_1_terminal_class.html#aa1218bbf01af0ccb59aef07ae36a8793" title="Read codes from keyboard. ">read()</a>, <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a44f4a4963f7b698583b237d20ee66fe5" title="Get the number of codes available in the keyboard queue. ">available()</a> and <a class="el" href="class_fab_g_l_1_1_terminal_class.html#ae4d97a111f6abc956586de7d75a8bc78" title="Read a code from the keyboard without advancing to the next one. ">peek()</a> methods.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>A string of ASCII codes to inject into the queue. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae4d97a111f6abc956586de7d75a8bc78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4d97a111f6abc956586de7d75a8bc78">&#9670;&nbsp;</a></span>peek()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int FabGL::TerminalClass::peek </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read a code from the keyboard without advancing to the next one. </p>
<p>Keyboard queue is available only after <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a21b8c89ca320cb271ee7204f7e661e48" title="Permits using of terminal locally. ">TerminalClass.connectLocally()</a> call.</p>
<dl class="section return"><dt>Returns</dt><dd>The next code, or -1 if none is available. </dd></dl>

</div>
</div>
<a id="a191fcce92df0611dad8dfe8dbda6466d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a191fcce92df0611dad8dfe8dbda6466d">&#9670;&nbsp;</a></span>pollSerialPort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::pollSerialPort </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pool the serial port for incoming data. </p>
<p>Tnis method needs to be called in the application main loop to check if new data is coming from the current serial port (specified using <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a050039c3c30e2591aa09d7b49073a452" title="Connect a remove host using the specified serial port. ">TerminalClass.connectSerialPort</a>).</p>
<p>Example: </p><pre class="fragment">  void loop()
  {
    Terminal.pollSerialPort();
  }</pre> 
</div>
</div>
<a id="aa1218bbf01af0ccb59aef07ae36a8793"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa1218bbf01af0ccb59aef07ae36a8793">&#9670;&nbsp;</a></span>read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int FabGL::TerminalClass::read </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read codes from keyboard. </p>
<p>Keyboard queue is available only after <a class="el" href="class_fab_g_l_1_1_terminal_class.html#a21b8c89ca320cb271ee7204f7e661e48" title="Permits using of terminal locally. ">TerminalClass.connectLocally()</a> call.</p>
<dl class="section return"><dt>Returns</dt><dd>The first code of incoming data available (or -1 if no data is available). </dd></dl>

</div>
</div>
<a id="aecadae9531f1f3be9767cf0cb857457d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aecadae9531f1f3be9767cf0cb857457d">&#9670;&nbsp;</a></span>setBackgroundColor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::setBackgroundColor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="vgacontroller_8h.html#ab329a30a424ffbdadd1871763dd5b433">Color</a>&#160;</td>
          <td class="paramname"><em>color</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>setAsDefault</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the background color. </p>
<p>Sets the background color sending an SGR ANSI code and optionally the default background color (used resetting the terminal).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">color</td><td>Current or default background color. </td></tr>
    <tr><td class="paramname">setAsDefault</td><td>If true the specified color is also used as default.</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><pre class="fragment">   Terminal.setBackgroundColor(Color::Black);</pre> 
</div>
</div>
<a id="a3bf4332fc5f7fd57ad13ee7444633bb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3bf4332fc5f7fd57ad13ee7444633bb7">&#9670;&nbsp;</a></span>setForegroundColor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::setForegroundColor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="vgacontroller_8h.html#ab329a30a424ffbdadd1871763dd5b433">Color</a>&#160;</td>
          <td class="paramname"><em>color</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>setAsDefault</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the foreground color. </p>
<p>Sets the foreground color sending an SGR ANSI code and optionally the default foreground color (used resetting the terminal).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">color</td><td>Current or default foreground color. </td></tr>
    <tr><td class="paramname">setAsDefault</td><td>If true the specified color is also used as default.</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><pre class="fragment">   Terminal.setForegroundColor(Color::White);</pre> 
</div>
</div>
<a id="ab11e6662766219868ea90beea5612f72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab11e6662766219868ea90beea5612f72">&#9670;&nbsp;</a></span>setLogStream()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void FabGL::TerminalClass::setLogStream </td>
          <td>(</td>
          <td class="paramtype">Stream &amp;&#160;</td>
          <td class="paramname"><em>stream</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set the stream where to output debugging logs. </p>
<p>Logging info sents to the logging stream are detailed by FABGLIB_TERMINAL_DEBUG_REPORT_.... macros in <a class="el" href="_fab_g_l_conf_8h.html" title="This file contains FabGL library configuration settings, like number of supported colors...">FabGLConf.h</a> configuration file.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stream</td><td>The logging stream.</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><pre class="fragment">   Serial.begin(115200);
   Terminal.begin();
   Terminal.setLogStream(Serial);</pre> 
</div>
</div>
<a id="a2540979f774634ea7264ba1e1764b380"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2540979f774634ea7264ba1e1764b380">&#9670;&nbsp;</a></span>write() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t FabGL::TerminalClass::write </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send specified number of codes to the display. </p>
<p>Codes can be ANSI/VT codes or ASCII characters.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>Pointer to codes buffer. </td></tr>
    <tr><td class="paramname">size</td><td>Number of codes in the buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of codes written.</dd></dl>
<p>Example: </p><pre class="fragment">   // Clear the screen and print "Hello World!"
   Terminal.write("\e[2J", 4);
   Terminal.write("Hellow World!\r\n", 15);

   // The same without size specified
   Terminal.write("\e[2J");
   Terminal.write("Hellow World!\r\n");</pre> 
</div>
</div>
<a id="a026b4983543e8ab8689cffa847b73d51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a026b4983543e8ab8689cffa847b73d51">&#9670;&nbsp;</a></span>write() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t FabGL::TerminalClass::write </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send a single code to the display. </p>
<p>Code can be only of the ANSI/VT codes or ASCII characters.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>The code to send.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of codes written. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="terminal_8h_source.html">terminal.h</a></li>
<li>terminal.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
